package com.prs.crm.dao.hr;

import java.sql.SQLException;
import java.util.Collection;
import java.util.List;
import com.prs.crm.dao.BaseDao;
import com.prs.crm.domain.hr.Check;
import com.prs.crm.domain.hr.Dept;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.hr.Role;

public interface PersonDao extends BaseDao<Person>{
	Person findByCode(final String code);
	
	Collection<Person> findByDeptRole(Dept dept, Role role);
	
	Collection<Person> findByDept(Dept dept);
	
	Collection<Person> findPersons(Collection<Integer> ids);
	
	Collection<Person> findAll();
	Collection<Person>  getAllPerson();
	public List<Person> getAllPersons();
	Collection<Person> getRootPersonBySubordinate();
	/**
	 * 根据用户名查找用户
	 * @param username
	 * @return
	 */
	Person findByUserName( String username);
	
	/**
	 * 根据用户名模糊查询
	 */
	Person  fuzzyFindByUserName( String username);
	
	/**
	 * 查找下一个用户
	 * @param person
	 * @return
	 */
	Person findNext(Person person);
	
	/**
	 * 查找上一个用户
	 * @param person
	 * @return
	 */
	Person findPrev(Person person);
	
	
	Person findFirstPerson();
	
	
	Collection<?> getReportPersonRoleSource();
	Collection<?> getReportPersonDeptSource();
	Collection<?> getReportPersonJobTitleSource();
	
	void removePerson(Person p);
	
	List<Person>  getNoticePerson(Role role);
	
	Person getByroot(String name);
	
	
	void saveOrUpdate(Person person);
	
	
	Person getPersonByMovie(Integer  movieId,String userStyle);
	
	Person getPersonByTicketer(Integer  ticketerId,String userStyle);

	Integer delByPerson();
	Person getPersonById(Integer id);
	void saveCenterTable(Person person) throws SQLException;
}
